package gdut.edu.demo02;

/**
 * @Description 双向循环链表测试类
 * @Author JiaFu
 * @Date 2022/9/5 22:16
 */
public class TestMyDoubleLoopNode {
    public static void main(String[] args) {
        MyDoubleLoopNode node1 = new MyDoubleLoopNode(1);
        MyDoubleLoopNode node2 = new MyDoubleLoopNode(2);
        MyDoubleLoopNode node3 = new MyDoubleLoopNode(3);
        MyDoubleLoopNode node4 = new MyDoubleLoopNode(4);
        System.out.println("--------------------");
        System.out.println(node1.pre().getData());
        System.out.println(node1.getData());
        System.out.println(node1.next().getData());
        System.out.println("--------------------");
        node1.insert(node2);
        System.out.println(node1.pre().getData());
        System.out.println(node2.next().getData());
        System.out.println(node2.getData());
        System.out.println("--------------------");
        node2.insert(node3);
        node3.insert(node4);
        System.out.println(node4.next().getData());
        System.out.println(node4.pre().getData());
        System.out.println(node1.getData());

    }
}
